﻿namespace Codeplex.Unity.AutoRegister
{
    using System;
    using Microsoft.Practices.Unity;

    /// <summary>
    /// Marker attribute, auto regist to UnityContainer.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
    public class UnityExportAttribute : Attribute
    {
        private static InjectionMember[] EmptyInjectionMemberArray = new InjectionMember[0];

        public UnityExportAttribute()
        {
            this.InjectionMembers = EmptyInjectionMemberArray;
        }

        /// <summary>
        /// Get and set FromType.
        /// </summary>
        public Type FromType { get; set; }

        /// <summary>
        /// Get and set Name.
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Get and set InjectionMember array. It use in sub class.
        /// </summary>
        public InjectionMember[] InjectionMembers { get; set; }

        /// <summary>
        /// Get and set LifetimeManager type.
        /// </summary>
        public Type LifetimeManager { get; set; }

        /// <summary>
        /// Get and set InjectionMemverProvider type.
        /// </summary>
        public Type InjectionMemberProvider { get; set; }
    }
}
